/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ac.za.cput.designpatterns.structural.adapter;

/**
 *
 * @author user
 */
public class TemperatureObjectReporter implements TemperatureInfo{

    CalciusReporter calciusReporter;
    
    public TemperatureObjectReporter(){
        calciusReporter = new CalciusReporter();
    }
    @Override
    public double getTemperatureInf() {
       return cToF(calciusReporter.getTemperature());
    }

    @Override
    public void setTemperatureInf(double temperatureInf) {
       calciusReporter.setTemperature(fToC(temperatureInf));
    }

    @Override
    public double getTemperatureInc() {
        return calciusReporter.getTemperature();
    }

    @Override
    public void setTemperatureInc(double temperatureInc) {
        calciusReporter.setTemperature(temperatureInc);
    }
    
     private double fToC(double f){
        return ((f-32) * 5/9);
    }
    
    public double cToF(double c){
        return ((c* 9 / 5) +32);
    }
}
